package VN.EDU.IMIC.DEVELOPER.TRINHCAOSANG.Exam01.Bai1.Bai1;


public class TamgiacEntity implements IGeometricObject {
    private double canh1;
    private double canh2;
    private double canh3;


    public double getCanh1() {
        return canh1;
    }

    public void setCanh1(double canh1) {
        this.canh1 = canh1;
    }

    public double getCanh2() {
        return canh2;
    }

    public void setCanh2(double canh2) {
        this.canh2 = canh2;
    }

    public double getCanh3() {
        return canh3;
    }

    public void setCanh3(double canh3) {
        this.canh3 = canh3;
    }

    @Override
    public double getArea(Object object) {
        double p = (canh1 + canh2 + canh3) / 2;

        return Math.sqrt(p * (canh1 * canh2 * canh3));
    }

    @Override
    public double getPerimeter(Object object) {
        return canh1 + canh2 + canh3;
    }

}
